import { instance, request } from "./request";

//获取验证码接口
export const reqVerifyApi = () => {
  return request({
    url: "/index/verify",
    method: "post",
  });
};

//登录请求
export const loginApi = (data) => {
  return instance({
    url: "/Login/index",
    method: "post",
    data,
  });
};

//获取用户信息接口
export const getUserInfo = () => {
  return instance({
    url: "/Membe/getMembe",
    method: "get",
  });
};

//获取用户系统公告
export const getUserNotice = () => {
  return instance({
    url: "/Index/notice_list",
    method: "get",
  });
};

//首页订单信息
export const pendingReview = () => {
  return instance({
    url: "/order/pendingReview",
    method: "get",
  });
};

export const pendingHandle = () => {
  return instance({
    url: "/order/pendingHandle",
    method: "get",
  });
};

export const allocableGoods = () => {
  return instance({
    url: "/warehouse/allocableGoods",
    method: "get",
  });
};

export const unallocated = () => {
  return instance({
    url: "/warehouse/unallocated",
    method: "get",
  });
};

export const scarceGoods = () => {
  return instance({
    url: "/warehouse/scarceGoods",
    method: "get",
  });
};

export const getTrack = (data) => {
  return instance({
    url: `/Logistics/getTrack?track_typ=${data}`,
    method: "get",
  });
};

//获取包裹数据
export const getData = () => {
  return instance({
    url: "/index/index",
    method: "get",
  });
};

//client_id变化后重新绑定membeId
export const bindMembeId = (data) => {
  return instance({
    url: "/Login/bindMembeId",
    method: "post",
    data,
  });
};
//接绑membeId
export const unbindMembeId = (data) => {
  return instance({
    url: "/Login/unbindMembeId",
    method: "post",
    data,
  });
};

//获取首页数据
export const getStatisticalData = (data) => {
  return instance({
    url: "/Index/statisticalData",
    method: "post",
    data,
  });
};

//获取统计图数据
export const getMonthLine = (data) => {
  return instance({
    url: "/Index/monthLine",
    method: "post",
    data,
  });
};
